package com.tablefood.dao;

import java.util.List;

import com.tablefood.domain.ShopProduct;
 

 

public interface ProductDao {

	//添加商品
	public boolean addProduct(ShopProduct product);
	
	//删除商品-更改销售状态
	public boolean delProducts(final Long productid);
	
	//更新商品
	public boolean updateProduct(ShopProduct product);
 
	// 检索产品名有无重复
	public boolean checkProductTitle(String title);

	//根据productid查询某件商品
	public ShopProduct searchProducts(Long productid);
	
	//根据categoryName种类名查询特定商品集
	public List searchProducts(String categoryName, int pageIndex, int pageSize);  //多态
	
	//根据种类名categoryName计算相应的商品总量
	public int getProductsCount(String categoryName);
	
	// 分页
	public List<ShopProduct> queryForPage(final String hql,final int offset,final int length);  
	
	// 查询所有的记录数 
	public int getAllRowCount(String hql);  
	
	// 解决中文乱码的查询页数
	public int getAllRowCount(String hql,String search);
	
	// 解决中文乱码的查询-分页
    public List<ShopProduct> queryForPage(final String hql,final String search,final int offset,final int length);  
		
	
}
